package com.property.management.service.impl;

import java.util.List;
import com.property.common.utils.DateUtils;
import com.property.common.utils.ShiroUtils;
import com.property.management.mapper.CourtInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.property.management.mapper.ComplainInfoMapper;
import com.property.management.domain.ComplainInfo;
import com.property.management.service.IComplainInfoService;
import com.property.common.core.text.Convert;

/**
 * 投诉信息Service业务层处理
 * 
 * @author property
 * @date 2021-05-08
 */
@Service
public class ComplainInfoServiceImpl implements IComplainInfoService 
{
    @Autowired
    private ComplainInfoMapper complainInfoMapper;
    @Autowired
    private CourtInfoMapper courtInfoMapper;
    /**
     * 查询投诉信息
     * 
     * @param id 投诉信息ID
     * @return 投诉信息
     */
    @Override
    public ComplainInfo selectComplainInfoById(Integer id)
    {
        return complainInfoMapper.selectComplainInfoById(id);
    }

    /**
     * 查询投诉信息列表
     * 
     * @param complainInfo 投诉信息
     * @return 投诉信息
     */
    @Override
    public List<ComplainInfo> selectComplainInfoList(ComplainInfo complainInfo)
    {
        return complainInfoMapper.selectComplainInfoList(complainInfo);
    }

    /**
     * 新增投诉信息
     * 
     * @param complainInfo 投诉信息
     * @return 结果
     */
    @Override
    public int insertComplainInfo(ComplainInfo complainInfo)
    {
        complainInfo.setCreateTime(DateUtils.getNowDate());
        return complainInfoMapper.insertComplainInfo(complainInfo);
    }

    /**
     * 修改投诉信息
     * 
     * @param complainInfo 投诉信息
     * @return 结果
     */
    @Override
    public int updateComplainInfo(ComplainInfo complainInfo)
    {
        complainInfo.setUpdateTime(DateUtils.getNowDate());
        return complainInfoMapper.updateComplainInfo(complainInfo);
    }

    /**
     * 删除投诉信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteComplainInfoByIds(String ids)
    {
        return complainInfoMapper.deleteComplainInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除投诉信息信息
     * 
     * @param id 投诉信息ID
     * @return 结果
     */
    @Override
    public int deleteComplainInfoById(Integer id)
    {
        return complainInfoMapper.deleteComplainInfoById(id);
    }
}
